package eleven;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;

public class UDPClient {
    public static void main(String[] args) throws Exception {
        System.out.println("UDPClient启动中...");
        DatagramSocket client = new DatagramSocket(8888);
        String data = "上海尚学堂";
        byte[] datas = data.getBytes();
        DatagramPacket packet = new DatagramPacket(datas, 0 ,datas.length,
                new InetSocketAddress("localhost", 9999));
        client.send(packet);

    }
}
